package com.isesol.ime.dal.mapper;

import com.isesol.arch.common.dal.*;
import com.isesol.ime.dal.model.*;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.*;

import java.util.*;

/**
 * 机床参数版本
 *
 * @author peter zhang
 */
@Repository
public interface ParamVersionMapper extends GenericMapper<ParamVersionDO> {

	@Select("select * from ime.param_version where type=#{type} and status='1'")
	ParamVersionDO findValidVersionByType(@Param("type") String type);

	@Delete("delete from ime.param_version where id=#{id}")
	void deleteById(@Param("id") long id);

	@Select("select * from ime.param_version")
	List<ParamVersionDO> findAll();

	@Select("select name from ime.param_version where status='1'")
	List<String> findAllValidName();

	@Select("select * from ime.param_version where status = '1'")
	List<ParamVersionDO> findActiveParamVersion();

}
